<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Google Maps JavaScript API Example: Simple Markers</title>
    <script src="http://maps.google.com/maps?file=api&;v=2&key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA"&sensor=false"
            type="text/javascript"></script>
    <script type="text/javascript">
    function initialize() {
		var map= new GMap2(document.getElementById("map_canvas"));
		var center= new GLatLng(30.28891,120.11639);
		map.setCenter(center, 13);
		map.enableScrollWheelZoom(); //增加鼠标滚轮缩放地图控制

		var marker= new GMarker(center, {draggable: true});

		GEvent.addListener(marker, "dragstart", function() {
		  map.closeInfoWindow();
		 });

		GEvent.addListener(marker, "dragend", function(latlng) {
		  //document.getElementById("longitude").value=latlng.x;//向隐藏域中赋值
		  //document.getElementById("latitude").value=latlng.y;
		    window.parent.document.getElementById("longitude").value=latlng.x;
		    window.parent.document.getElementById("latitude").value=latlng.y;
		 });
		map.addOverlay(marker);
		map.addControl(new GSmallMapControl());//增加控制条
		map.addControl(new GMapTypeControl());//增加卫星地图和普通地图的显示
     }
    </script>
  </head>
  <body onload="initialize()" onunload="GUnload()">
    <div id="map_canvas" style="width: 230px; height: 230px"></div>
  </body>
</html>
